package com.zjitc;

import com.zjitc.p1.config.JavaConfigDemo2;
import com.zjitc.obj.Teacher;
import com.zjitc.obj.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/6 15:48
 * @description:
 */
public class App3 {

  public static void main(String[] args) {
    //new ClassPathXmlApplicationContext("...xml")
    ApplicationContext context=new AnnotationConfigApplicationContext(JavaConfigDemo2.class);
    User u1=context.getBean("u1",User.class);
    User u2=context.getBean("u1",User.class);
    Teacher t1=context.getBean("teacher",Teacher.class);
    if (u1.equals(u2)){
      System.out.println("equals");
    }
    System.out.println(u1);
    System.out.println(u2);
    System.out.println(t1);

  }
}
